import java.util.Scanner;

/**
   Counts the number of digits with value 7 in the decimal 
   representation of the integer n
*/
public class CountSevens
{
   public static void main(String[] args)
   {
      Scanner in = new Scanner(System.in);
      int n = in.nextInt();

      // your work here
      String s = String.valueOf(n);
      int count = 0;
      for(int i=0;i<s.length();i++){
          if(s.charAt(i) == '7'){
              count++;
          }
      }
      System.out.println(count);
   }
}